home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(Start == true && Dead == false)
- {
- if(hits == 0)
- {
- if(dir == 1)
- {
- this.Boss.gotoAndStop(2);
- }
- else if(dir == 2)
- {
- this.Boss.gotoAndStop(3);
- }
- }
- else if(hits >= 1 && hits < 10)
- {
- if(dir == 1)
- {
- this.Boss.gotoAndStop(4);
- }
- else if(dir == 2)
- {
- this.Boss.gotoAndStop(5);
- }
- }
- else if(hits >= 10 && hits < 20)
- {
- if(dir == 1)
- {
- this.Boss.gotoAndStop(6);
- }
- else if(dir == 2)
- {
- this.Boss.gotoAndStop(7);
- }
- }
- else if(hits >= 20)
- {
- this.Boss.gotoAndStop(8);
- Dead = true;
- }
- a = 1;
- while(a <= _root.Ship.i)
- {
- if(this.hitTest(_root["Bullet" + a]))
- {
- hits += 1;
- removeMovieClip(_root["Bullet" + a]);
- }
- a++;
- }
- _X = _X + (xspeed - Math.sin(_root.Ship.angle * 0.017453292519943295) * 3);
- _Y = _Y + (yspeed + Math.cos(_root.Ship.angle * 0.017453292519943295) * 3);
- if(_root.Ship.hitTest(_X,_Y,true) && _root.Ship.Dead == false)
- {
- _root.Ship.gotoAndStop("Death");
- _root.Start = false;
- _root.Ship.Dead = true;
- }
- if(_X < -60)
- {
- xspeed = -1;
- dir = 1;
- _X = 510;
- }
- if(_X > 510)
- {
- xspeed = 1;
- dir = 2;
- _X = -60;
- }
- if(_Y < 20)
- {
- _Y = 530;
- }
- if(_Y > 530)
- {
- _Y = 20;
- }
- }
- }
-